// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import $ from 'jquery'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '../static/css/unit.css';
import store from '@/vuex/store.js'
import {makeRouter} from '@/js/unit.js'
Vue.config.productionTip = false




 router.beforeEach(async (to,from,next)=>{
   if(to.path==='/'){
     next();
   }else{
     const token=store.state.token;
    if(!token){
      next('/')
    }else{
      next();
    }
   }
  })




/* eslint-disable no-new */
Vue.use(ElementUI);
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
